Skip to content

build: speedup compile times via dev-profile debuginfo, git2 0.20, rustls - #4

Open
jakob1379 wants to merge 2 commits into
jamesaphoenix:mainfrom
jakob1379:fix/improve-compile-time
Open

build: speedup compile times via dev-profile debuginfo, git2 0.20, rustls#4
jakob1379 wants to merge 2 commits into
jamesaphoenix:mainfrom
jakob1379:fix/improve-compile-time

Conversation

@jakob1379

Copy link
Copy Markdown

What

Three independent, behavior-preserving changes to the dependency graph and dev profile:

  1. Dev-profile debuginfo cuts (workspace Cargo.toml): workspace crates emit
    line-tables-only (backtraces keep file:line), dependencies and build scripts emit
    none. Nobody steps through tokio/tauri internals in a debugger; full debug = 2 for
    750 dep crates was pure cost. target/ shrinks 3.5G → 2.2G.

  2. git2 0.19 → 0.20, default-features = false, moved to [workspace.dependencies]:
    diffcore only performs local git operations (Repository::open/discover/init, diffs,
    statuses, branches — verified by grep, no clone/fetch/push/remote/credential usage
    anywhere). Dropping the default ssh/https transport features removes libssh2-sys,
    openssl-sys, and the vendored-OpenSSL C build from the graph entirely, and shrinks
    the bundled libgit2 build.

  3. reqwest: native-tls → rustls-tls-native-roots (diffcore-core, and the
    diffcore-tauri dev-dependency): unifies on the rustls stack tauri-plugin-updater
    already compiles, instead of building two TLS stacks. native-roots (not plain
    rustls-tls) keeps the **syate proxies / private CAs
    keep working; macos-system-configuration keeps macOS proxy detection. Side benefit:
    cargo test no longer needs

Numbers

Measured with hyperfine on a 16` between runs):

Scenario Before After
Full clean dev build, plain cargo 177.6s ~125–135s
Full clean, with mold + warm sccache 61.1s ± 0.7s (n=3)
Workspace-only rebuild (cargo clean -p × 3 crates) 26.5s
Incremental (core + tauri edit) ~8s ~8s

Single-shot timings on this workload swing ±25% with thermal state — the hyperfine
numbers are the trustworthy one

Verification

  • 2191/2191 tests pass (`cargo
  • Both binaries build clean; git2 0.20 API migration needed zero code changes
  • cargo tree -i native-tls / build graph, dev-deps
    included (native-tls only appears under the optional embeddings feature via hf-hub)
  • Reviewed in two rounds by thrrectness, over-engineering,
    requirements); all findings resolved or refuted with measurements

Notes

  • No runtime behavior change intended. The one real risk surface — TLS trust — is
    explicitly preserved via `nat
  • mold/sccache setup is deliberately not committed (hardcoding a linker breaks
    machines without it); a nix d as a follow-up.

- dev profile: line-tables-only for workspace code, no debuginfo for
  dependencies and build scripts
- git2 0.19 -> 0.20 as a workspace dependency with default-features off:
  only local git operations are used, so the ssh/https transports,
  libssh2-sys, and vendored openssl leave the build graph
- diffcore-core reqwest: rustls-tls-native-roots (system trust store
  kept) instead of native-tls; tauri dev-dep reqwest likewise, so cargo
  test no longer needs system OpenSSL headers

Full clean dev build 177.6s -> ~125-135s with plain cargo; 61.1s +/- 0.7s
(hyperfine, n=3) with the mold+sccache devShell. 2191 tests pass.
New headless axum binary serves the built UI and mirrors the tauri IPC
surface over HTTP so diffs can be reviewed on a remote server:

- commands decoupled from tauri: cfg-swapped State shim, process-global
  background runtime replacing tauri::async_runtime, cfg-gated watchers;
  features 'desktop' (default) and 'web' are mutually exclusive
- POST /api/invoke/{cmd} (camelCase args, 1:1 with tauri IPC),
  GET /api/health, same-origin SSE job streams, SPA static serving
- Host/Origin allowlist guard (DNS-rebinding/CSRF) + strict JSON bodies;
  editor and file-watch commands are desktop-only (501 on web)
- frontend transport priority: Tauri IPC -> web API (health probe) ->
  demo mocks; desktop-only UI hidden in web mode
- 8 integration tests for the HTTP surface

Deliberate v1 cuts (see specs/web-server-mode.md): no auth (loopback
bind, tunnel/reverse-proxy for remote), single shared AppState.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant